﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no, maximum-scale=1.0" />
    <title>企业列表</title>
    <link rel="stylesheet" type="text/css" href="/css/common.css" />
    <link rel="stylesheet" type="text/css" href="/css/index.css" />
    <link rel="stylesheet" type="text/css" href="/css/enterprise.css" />
    <link rel="stylesheet" type="text/css" href="/css/pullToRefresh.css" />
</head>

<body class="bg_ef">
    <div class="container">
        <div class="header">
            
           <div class="headbg"><a href="/index.html" class="return"></a></div>
            <p>企业列表</p>
        </div>
        <div class="tz_seach">
            <div class="box">
                <input type="text" placeholder="请输入企业名称或者点评类型" id="SearchValue" />
                <input type="button" value="搜索" onclick="SearchSubmit()" />
            </div>
        </div>

        
            <div class="s-index-side" id="wrapper">
                <ul class="weekly-list cls" id="lawUl">
                   
                </ul>
            </div>
    </div>
</body>
</html>

<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
<script src="/static/usi/core.js"></script>
<script src="/static/usi/tools.js"></script>
<script src="/js/iscroll.js"></script>
<script src="/js/pullToRefresh.js"></script>
<script>
    refresher.init({

        id: "wrapper",
        divId:"scroller",
        pullUpAction: Load,
        pullDownAction: Refresh,
    });

    function Refresh() {
        myScroll.refresh();
    }
    function Load() {
        if (isData) {
            if (_val != $("#SearchValue").val()) {
                $("#lawUl").html("");
                vcurrentPage = 1;
            }
            else
            vcurrentPage = vcurrentPage + 1;
            LoadNewsData();
            myScroll.refresh();
        } else {
            myScroll.refresh();
        }
    }
    var vcurrentPage = 1;
    window.onload = function () {
        LoadNewsData();
    }
    function SearchSubmit() {
        $("#lawUl").html("");
        isData = true;
        vcurrentPage = 1;
        _val = $("#SearchValue").val();
        LoadNewsData();
    }
    var isData = true;
    var _val = "";
    //function LoadNewsData() {
    //    _val = $("#SearchValue").val();
    //    jQuery.usi.core.get(ip + api + "/GetEnterpriseData", { whereValue: $("#SearchValue").val(), currentPage: vcurrentPage, pageSize: 3 }, false, function (data) {
    //        if (!jQuery.usi.core.isNullOrEmpty(data.data)) {
    //            $.each(data.data, function (index, item) {
    //                var li = $('<li></li>');
    //                var div1 = $('<div class="app-show-title"></div>');
    //                var a1 = $('<a href="/page/enterpriseDetail.html?Unid=' + item.unid + '">' + (jQuery.usi.core.isNullOrEmpty(item.name) ? "无" : item.name) + '</a>');
    //                div1.append(a1);
    //                var div2 = $('<div class="app-show-block"></div>');
    //                var a2 = $('<a class="pic"><span>' + (jQuery.usi.core.isNullOrEmpty(item.areaName) ? "未知" : item.areaName) + '</span></a>');
    //                var div22 = $('<div></div>');
    //                var div222 = $('<div></div>');
    //                var span = $('<span>' + (jQuery.usi.core.isNullOrEmpty(item.typeName) ? "未点评" : item.typeName) + '</span>');
    //                div222.append(span);
    //                div22.append(div222);
    //                div222.append(span);
    //                var a3 = $('<a href="/page/comment.html?Unid=' + item.unid + '&Name=' + escape(item.name) + '" data-icon="/images/1.png" class="event-exe-install s-index-down s-index-icon" tjurl="#">点评</a>');
    //                div2.append(a2).append(div22).append(a3);
    //                li.append(div1).append(div2)
    //                $("#lawUl").append(li);
    //            });
    //        } else {
    //            layer.alert("未查询到信息！");
    //            isData = false;
    //        }
    //    });
    //}
    function LoadNewsData() {
        _val = $("#SearchValue").val();
        jQuery.usi.core.get(ip + api + "/GetEnterpriseData", { whereValue: $("#SearchValue").val(), currentPage: vcurrentPage, pageSize:5 }, false, function (data) {
            if (!jQuery.usi.core.isNullOrEmpty(data.data)) {
                $.each(data.data, function (index, item) {
                    var li = $('<li></li>');
                    var div1 = $('<section><img data-v-2df9c5b6="" src="/image/bg2.png" class="shop_img"></section>');
                    var div2 = $('<hgroup></hgroup>');
                    var div3 = $('<header class="shop_detail_header"></header>');
                    var a1 = $('<a href="/page/enterpriseDetail.html?Unid=' + item.unid + '">' + (jQuery.usi.core.isNullOrEmpty(item.name) ? "无" : item.name) + '</a>');
                    div3.append(a1);
                    var divh5 = $('<h5 class="shop_detail_area"></h5>');
                    var aspan = $('<span>所属地区</span>' + (jQuery.usi.core.isNullOrEmpty(item.areaName) ? "无" : item.areaName));
                    divh5.append(aspan);
                    var shop_detail_rat = $('<h5 class="shop_detail_rat"></h5>');
                    var rat_span = $('<span>'+(jQuery.usi.core.isNullOrEmpty(item.typeName) ? "未点评" : item.typeName)+'</span>');
                    var rat_a = $('<a href="/page/comment.html?Unid=' + item.unid + '&Name=' + escape(item.name) + '" data-icon="/images/1.png" class="event-exe-install s-index-down s-index-icon" tjurl="#">点评</a>');
                    shop_detail_rat.append(rat_span).append(rat_a);

                    div2.append(div3).append(divh5).append(shop_detail_rat);
                    li.append(div1).append(div2);

                    $("#lawUl").append(li);
                });
            } else {
                layer.alert("未查询到信息！");
                isData = false;
            }
        });

    }

</script>

<!--<section><img data-v-2df9c5b6="" src="http://cangdu.org:8001/img/15e386ec1875697.jpeg" class="shop_img"></section>
                        <hgroup>
                            <header class="shop_detail_header">
                                文成县日立案聊友当
                            </header>
                            <h5 class="shop_detail_area">
                                <span>所属地区</span>曹县
                            </h5>
                            <h5 class="shop_detail_rat">
                                <span>中评</span>
                                <a href="/page/comment.html" data-icon="/images/1.png" class="event-exe-install s-index-down s-index-icon" tjurl="#">点评</a>
                            </h5>
                        </hgroup>-->